package com.tonghe.dao.user;

import com.tonghe.pojo.Role;
import com.tonghe.pojo.User;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

/**
 * @Date:2021/12/2- 12- 02- 20:37
 **/
public interface UserDao {
    //得到要登陆的用户 、、通过userCode
    public User getLoginUser(Connection connection, String userCode) throws SQLException;

    //修改当前用户密码
    public int updatePwd(Connection connection,int id, String password) throws SQLException;

    //
    public int getUserCount(Connection connection, String username, int userRole)throws SQLException;

    //获取用户列表                                                                            考虑分页  前面的参数与上面的getUserCount一样
    public List<User> getUserList(Connection connection, String userName, int userRole, int currentPageNo,int pageSize) throws SQLException;

    //添加用户
    public int add(Connection connection, User user)throws SQLException;
}
